include $(DIR_MAKEFILET)/python.mk

# for now: by default a project-related virtual environment is used (deprecated)
# TODO: remove the deprecated setting and switch to "disabled by default"
DISABLE_CUSTOM_VIRTUALENV ?= 0
# defaults to empty in order to allow an explicit override of 'DISABLE_CUSTOM_VIRTUALENV'
PYTHON_VIRTUALENV_ENABLE ?=
ifeq ($(PYTHON_VIRTUALENV_ENABLE),1)
	include $(DIR_MAKEFILET)/python-virtualenv.mk
else
# `PYTHON_VIRTUALENV_ENABLE=0` will disable the obsolete 'DISABLE_CUSTOM_VIRTUALENV' handling
ifneq ($(PYTHON_VIRTUALENV_ENABLE),0)
ifneq ($(DISABLE_CUSTOM_VIRTUALENV),1)
	VIRTUALENV_REQUIREMENTS_FILE ?= requirements.txt
	ifneq ($(wildcard $(VIRTUALENV_REQUIREMENTS_FILE)),)
		include $(DIR_MAKEFILET)/python-virtualenv.mk
	endif
endif
endif
endif


ifneq ($(wildcard manage.py),)
	include $(DIR_MAKEFILET)/python-django.mk
endif
# set the test arguments if they were not overridden by another component (e.g. Django)
PYTHON_TEST_ARGS ?= -m unittest discover
